<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>淘票票影城系统</title>
    <link rel="stylesheet" th:href="@{/css/semantic.min.css}">
    <link rel="stylesheet" th:href="@{/css/admin.css}">
    <script type="text/javascript" th:src="@{/js/jquery-3.4.1.js}"></script>
    <script type="text/javascript" th:src="@{/js/semantic.min.js}"></script>
</head>
<body>
<div class="ui top attached  menu">
    <a class="ui item button"><i class="sidebar icon"></i>菜单 </a>
    <a th:href="@{/admin/logout}" class="right item"><i class="sign-out icon"></i>退出</a>
</div>
<div class="ui  sidebar inverted vertical menu">
    <div class="item">
        <h4 class="ui blue header">影城管理系统</h4>
    </div>
    <a th:href="@{/admin/index}" class="item">首页</a>
    <a th:href="@{/admin/hall}" class="active item">影厅管理</a>
    <a th:href="@{/admin/time}" class="item">排片管理</a>
    <a th:href="@{/admin/cinema}" class="item">影院管理</a>
    <a th:href="@{/admin/orders}" class="item">订单管理</a>
</div>

<!--内容区域-->
<div class="m-container-small m-padded-tb-big">
<div class="ui container">
    <form id="hall-form"  th:object="${hall}" th:action="@{/admin/halls}"  method="post" class="ui form">
        <input type="hidden" name="id" th:value="*{id}">
        <input type="hidden" name="status" th:value="*{status}">
        <input type="hidden" name="cinemaId" th:value="${session.admin.cinemaId}">
        <div class="required field">
            <div class="ui left labeled input">
                <label class="ui teal basic label">名称</label>
                <input type="text" name="name" th:value="*{name}" placeholder="影厅名称">
            </div>
        </div>
        <div class="required field">
            <textarea name="seat" th:text="*{seat}" placeholder="影厅座位排布"></textarea>
        </div>

        <div class="ui error message"></div>
        <div class="ui right aligned container">
            <button type="button" class="ui button" onclick="window.history.go(-1)">返回</button>
            <button type="button" id="publish-btn" class="ui teal button">添加</button>
        </div>
    </form>
</div>
</div>

<script>
    $(".ui.button").click(function () {
        $(".ui.sidebar")
            .sidebar({
                transition:'slide out'
            })
            .sidebar("toggle");
    })

    $('#publish-btn').click(function () {
        $('#hall-form').submit();
    })

    $('.ui .form').form({
        fields: {
            name: {
                identifier: 'name',
                rules: [{
                    type: 'empty',
                    prompt: '名称：请输入影院名称'
                }]
            },
            seat: {
                identifier: 'seat',
                rules: [{
                    type: 'empty',
                    prompt: '座位排布：请输入影厅座位排布'
                }]
            },

        }
    })
</script>
</body>
</html>